import axios from 'axios'
const baseURL = "http://127.0.0.1:3456"
const deviceNameList:string[] = ["紫外","红外","温度","湿度","压力"]
let flog = true
// 控制阀门
//@ts-ignore
self.date = new Date()
self.onmessage = (e) => {
   let data = JSON.parse(e.data)
   let userList = data.phoneList
   let module_id = data.module_id
   let type_id = data.type
   // @ts-ignore
   console.log( new Date() - self.date)
   //@ts-ignore
   if ( flog || (new Date() - self.date > 10000)) {
    flog = false
    if (userList.length === 1) {
        // 单发短信
        console.log("单发短信" + module_id + deviceNameList[type_id])
     } else {
       // 群发短信
       console.log("群发短信")
     }
     //@ts-ignore
     self.date = new Date()
   }
  
}